#ifndef MCSHEAD_H
#define MCSHEAD_H

#include "IStreamLoadableWritable.h"

class McsHead : IStreamLoadableWritable
{
public:
    McsHead(int width_, int height_, int frameCount_, bool isWithShadow, bool isWithRemap);
    McsHead() = default;
    inline const int& GetWidth() const { return this -> width; }
    inline const int& GetHeight() const { return this -> height; }
    inline const int& GetFrameCount() const { return this -> frameCount; }
    inline bool IsWithShadow() const { return bool(McsType & Shadow); }
    inline bool IsWithRemap() const { return bool(McsType & Remap); }
private:
    enum FrameInfo : uint8_t
    {
        Shadow = 0x01,
        Remap = 0x02,
        Depth = 0x04,
    };
    int width = 0;
    int height = 0;
    int frameCount = 0;
    uint8_t McsType = 0;
public:
    bool TryLoad(std::istream& i) final;
    bool TryDump(std::ostream& o) final;
    bool IsDumpable() final;
};


#endif //MCSHEAD_H
